package graph;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.xy.XYDataset;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RefineryUtilities;
import zagaynov.Properties;
import zagaynov.Zagaynov;

import javax.swing.*;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableModel;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.List;
import java.util.Map;

public class ZagaynovGUI {
    static JFrame frame;


    public static void main(String s[]) throws ClassNotFoundException, UnsupportedLookAndFeelException, IllegalAccessException, InstantiationException {
        UIManager.setLookAndFeel(
                UIManager.getSystemLookAndFeelClassName());
        ZagaynovGUI gui = new ZagaynovGUI();
        gui.test();
    }

    private void test() {
        JFrame frame = new JFrame("RG");
        frame.setContentPane(new RG(this).rootField);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        RefineryUtilities.centerFrameOnScreen(frame);
        frame.setVisible(true);

    }

    public void calculate(Properties properties) {
        Zagaynov z = new Zagaynov();
        Map<Double, List<Double>> results = z.doCalculations(properties);
       ZagaynovChart zc = new ZagaynovChart(results, properties);
    }
}
